<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateExcelChecksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('excel_checks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('excel_id')      ->default(0)->comment('excel的id');
            $table->mediumText('error_message') ->nullable()->comment('excel的错误信息');
            $table->mediumText('notice')        ->nullable()->comment('excel的统计信息');
            $table->tinyInteger('allow_import') ->default(0)->comment('是否允许导入');
            $table->tinyInteger('in_execution') ->default(0)->comment('是否在执行');
            $table->tinyInteger('success_import') ->default(0)->comment('导入是否成功');
            $table->mediumText('import_result')   ->nullable()->comment('导入结果');
            $table->integer('total_num')        ->default(0)->comment('总条数');
            $table->integer('success_num')       ->nullable()->comment('操作成功数');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('excel_checks');
    }
}
